<body onresize="bodyResize()" onload="bodyResize()">
<script src="webgl_matrix.js" charset="utf-8"></script>
<script src="demo-lesson6.js" charset="utf-8"></script>

<div style="position:relative;border:groove;background-color: #ddd;margin:20px;width:80%;height:550px;"><div style="margin:10px 0;position:relative;width:100%;height:500px;background-color: #d00;" id="canvas_father" onmousedown="mouseDown(event)" onmouseup="mouseUp()" onmousemove="rotate(event)">
<canvas id="webgl-lesson6" style="width:100%;height:100%;position:relative;"></canvas></div>
<input style="width:20%;height:30px;margin: 0 3%;" type="button" value="genModel" title="重置画面" onclick="resetModel()"><input style="width:20%;height:30px;margin: 0 3%;" type="button" value="ortho" title="平行投影" onclick = "setOrtho()"><input style="width:20%;height:30px;margin: 0 3%;" type="button" value="perspective" title="透视投影" onclick="setPerspective()"></div>

<script>
function bodyResize()
{
	var divObj = document.getElementById("canvas_father");
	var cvsObj = document.getElementById("webgl-lesson6");
	cvsObj.width = divObj.clientWidth;
	cvsObj.height = divObj.clientHeight;
	resizeCanvas(cvsObj.width, cvsObj.height);
	drawCanvas('webgl-lesson6')
}

setInterval("drawCanvas('webgl-lesson6')", 20);
</script>
</body>